home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.0 / stk-3 / blt-for-STk-3.0 / blt-1.9 / configure < prev    next >
Encoding:
Text File  |  1995-12-19  |  35.8 KB  |  1,418 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=src/bltInit.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. # -----------------------------------------------------------------------
  133. #
  134. #     C compiler and debugging flags
  135. #
  136. # -----------------------------------------------------------------------
  137. # check whether --with-gcc was given
  138. withval="$with_gcc"
  139. if test -n "$withval"; then
  140.   CC=gcc
  141. fi
  142.  
  143. # check whether --with-acc was given
  144. withval="$with_acc"
  145. if test -n "$withval"; then
  146.   CC=acc
  147. fi
  148.  
  149. # check whether --with-lcc was given
  150. withval="$with_lcc"
  151. if test -n "$withval"; then
  152.   CC=lcc
  153. fi
  154.  
  155. # check whether --with-cc was given
  156. withval="$with_cc"
  157. if test -n "$withval"; then
  158.   CC=cc
  159. fi
  160.  
  161. if test -z "$CC" ; then 
  162.     CC=cc
  163. fi
  164. compiler=`basename $CC`
  165. if test "$compiler" = "gcc" ; then
  166.     CC="$CC -fwritable-strings -Wall"
  167. fi
  168.  
  169.  
  170. CDEBUGFLAGS="-O"
  171. # check whether --with-debug was given
  172. withval="$with_debug"
  173. if test -n "$withval"; then
  174.   CDEBUGFLAGS=-g
  175. fi
  176.  
  177.  
  178.  
  179. # -----------------------------------------------------------------------
  180. #
  181. #     Set prefix variable if one wasn't provided
  182. #
  183. # -----------------------------------------------------------------------
  184. if test -z "$prefix" ; then
  185.     prefix=/usr/local/blt
  186. fi
  187.  
  188.  
  189. # -----------------------------------------------------------------------
  190. #
  191. #     Set PWD variable if vendor's /bin/sh doesn't
  192. #
  193. # -----------------------------------------------------------------------
  194. if test -z "$PWD" ; then
  195.     PWD=`pwd`
  196. fi
  197.  
  198. # -----------------------------------------------------------------------
  199. #
  200. #     Check for existence of ranlib and install programs
  201. #
  202. # -----------------------------------------------------------------------
  203. # Make sure to not get the incompatible SysV /etc/install and
  204. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  205. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  206. # or the AFS install, which mishandles nonexistent args, or
  207. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  208. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  209. # anyway.  Sigh.
  210. if test "z${INSTALL}" = "z" ; then
  211.   echo checking for install
  212.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  213.   for dir in $PATH; do
  214.     test -z "$dir" && dir=.
  215.     case $dir in
  216.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  217.     *)
  218.       if test -f $dir/installbsd; then
  219.     INSTALL="$dir/installbsd -c" # OSF1
  220.     INSTALL_PROGRAM='$(INSTALL)'
  221.     INSTALL_DATA='$(INSTALL) -m 644'
  222.     break
  223.       fi
  224.       if test -f $dir/install; then
  225.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  226.       : # AIX
  227.     else
  228.       INSTALL="$dir/install -c"
  229.       INSTALL_PROGRAM='$(INSTALL)'
  230.       INSTALL_DATA='$(INSTALL) -m 644'
  231.       break
  232.     fi
  233.       fi
  234.       ;;
  235.     esac
  236.   done
  237.   IFS="$saveifs"
  238. fi
  239. INSTALL=${INSTALL-cp}
  240. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  241. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  242. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  243. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  244. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  245.  
  246. if test -z "$RANLIB"; then
  247.   # Extract the first word of `ranlib', so it can be a program name with args.
  248.   set dummy ranlib; word=$2
  249.   echo checking for $word
  250.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  251.   for dir in $PATH; do
  252.     test -z "$dir" && dir=.
  253.     if test -f $dir/$word; then
  254.       RANLIB="ranlib"
  255.       break
  256.     fi
  257.   done
  258.   IFS="$saveifs"
  259. fi
  260. test -z "$RANLIB" && RANLIB=":"
  261. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  262.  
  263. echo checking how to run the C preprocessor
  264. if test -z "$CPP"; then
  265.   # This must be in double quotes, not single quotes, because CPP may get
  266.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  267.   # make.  It must be expanded now.
  268.   CPP="${CC-cc} -E"
  269.   cat > conftest.c <<EOF
  270. #include "confdefs.h"
  271. #include <stdio.h>
  272. Syntax Error
  273. EOF
  274. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  275. if test -z "$err"; then
  276.   :
  277. else
  278.   rm -rf conftest*
  279.   CPP=/lib/cpp
  280. fi
  281. rm -f conftest*
  282. fi
  283. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  284.  
  285.  
  286.  
  287.  
  288. # -----------------------------------------------------------------------
  289. #
  290. #     Check for header files
  291. #
  292. # -----------------------------------------------------------------------
  293. echo checking for ANSI C header files
  294. cat > conftest.c <<EOF
  295. #include "confdefs.h"
  296. #include <stdlib.h>
  297. #include <stdarg.h>
  298. #include <string.h>
  299. #include <float.h>
  300. EOF
  301. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  302. if test -z "$err"; then
  303.   rm -rf conftest*
  304.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  305. echo '#include "confdefs.h"
  306. #include <string.h>' > conftest.c
  307. eval "$CPP conftest.c > conftest.out 2>&1"
  308. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  309.   rm -rf conftest*
  310.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  311. cat > conftest.c <<EOF
  312. #include "confdefs.h"
  313. #include <ctype.h>
  314. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  315. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  316. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  317. int main () { int i; for (i = 0; i < 256; i++)
  318. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  319. exit (0); }
  320.  
  321. EOF
  322. eval $compile
  323. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  324.   
  325. {
  326. test -n "$verbose" && \
  327. echo "    defining STDC_HEADERS"
  328. echo "#define" STDC_HEADERS 1 >> confdefs.h
  329. DEFS="$DEFS -DSTDC_HEADERS=1"
  330. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  331. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  332. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  333. "
  334. }
  335.  
  336.  
  337. fi
  338. rm -fr conftest*
  339.  
  340. fi
  341. rm -f conftest*
  342.  
  343.  
  344. fi
  345. rm -f conftest*
  346.  
  347. for hdr in stdlib.h string.h float.h malloc.h
  348. do
  349. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  350. echo checking for ${hdr}
  351. cat > conftest.c <<EOF
  352. #include "confdefs.h"
  353. #include <${hdr}>
  354. EOF
  355. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  356. if test -z "$err"; then
  357.   rm -rf conftest*
  358.   
  359. {
  360. test -n "$verbose" && \
  361. echo "    defining ${trhdr}"
  362. echo "#define" ${trhdr} 1 >> confdefs.h
  363. DEFS="$DEFS -D${trhdr}=1"
  364. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  365. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  366. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  367. "
  368. }
  369.  
  370.  
  371. fi
  372. rm -f conftest*
  373. done
  374.  
  375. for hdr in errno.h unistd.h memory.h limits.h sys/time.h sys/wait.h
  376. do
  377. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  378. echo checking for ${hdr}
  379. cat > conftest.c <<EOF
  380. #include "confdefs.h"
  381. #include <${hdr}>
  382. EOF
  383. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  384. if test -z "$err"; then
  385.   rm -rf conftest*
  386.   
  387. {
  388. test -n "$verbose" && \
  389. echo "    defining ${trhdr}"
  390. echo "#define" ${trhdr} 1 >> confdefs.h
  391. DEFS="$DEFS -D${trhdr}=1"
  392. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  393. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  394. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  395. "
  396. }
  397.  
  398.  
  399. fi
  400. rm -f conftest*
  401. done
  402.  
  403. echo checking for whether time.h and sys/time.h may both be included
  404. cat > conftest.c <<EOF
  405. #include "confdefs.h"
  406. #include <sys/types.h>
  407. #include <sys/time.h>
  408. #include <time.h>
  409. int main() { exit(0); }
  410. int t() { struct tm *tp; }
  411. EOF
  412. if eval $compile; then
  413.   rm -rf conftest*
  414.   
  415. {
  416. test -n "$verbose" && \
  417. echo "    defining TIME_WITH_SYS_TIME"
  418. echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
  419. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  420. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  421. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  422. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  423. "
  424. }
  425.  
  426.  
  427. fi
  428. rm -f conftest*
  429.  
  430.  
  431. # -----------------------------------------------------------------------
  432. #     Check for strerror, strdup, strcasecmp.
  433. # -----------------------------------------------------------------------
  434. for func in strerror strdup strcasecmp
  435. do
  436. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  437. echo checking for ${func}
  438. cat > conftest.c <<EOF
  439. #include "confdefs.h"
  440. #include <ctype.h>
  441. int main() { exit(0); }
  442. int t() { 
  443. /* The GNU C library defines this for functions which it implements
  444.     to always fail with ENOSYS.  Some functions are actually named
  445.     something starting with __ and the normal name is an alias.  */
  446. #if defined (__stub_${func}) || defined (__stub___${func})
  447. choke me
  448. #else
  449. /* Override any gcc2 internal prototype to avoid an error.  */
  450. extern char ${func}(); ${func}();
  451. #endif
  452.  }
  453. EOF
  454. if eval $compile; then
  455.   rm -rf conftest*
  456.   {
  457. test -n "$verbose" && \
  458. echo "    defining ${trfunc}"
  459. echo "#define" ${trfunc} 1 >> confdefs.h
  460. DEFS="$DEFS -D${trfunc}=1"
  461. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  462. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  463. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  464. "
  465. }
  466.  
  467.  
  468. fi
  469. rm -f conftest*
  470. done
  471.  
  472. echo checking for size_t in sys/types.h
  473. echo '#include "confdefs.h"
  474. #include <sys/types.h>' > conftest.c
  475. eval "$CPP conftest.c > conftest.out 2>&1"
  476. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  477.   :
  478. else
  479.   rm -rf conftest*
  480.   
  481. {
  482. test -n "$verbose" && \
  483. echo "    defining" size_t to be unsigned
  484. echo "#define" size_t unsigned >> confdefs.h
  485. DEFS="$DEFS -Dsize_t=unsigned"
  486. SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
  487. \${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
  488. \${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
  489. "
  490. }
  491.  
  492. fi
  493. rm -f conftest*
  494.  
  495.  
  496. LOSSAGE=""
  497. #--------------------------------------------------------------------
  498. #    The check below checks whether <sys/wait.h> defines the type
  499. #    "union wait" correctly.  It's needed because of weirdness in
  500. #    HP-UX where "union wait" is defined in both the BSD and SYS-V
  501. #    environments.  Checking the usability of WIFEXITED seems to do
  502. #    the trick.
  503. #--------------------------------------------------------------------
  504.  
  505. echo checking for union wait
  506. cat > conftest.c <<EOF
  507. #include "confdefs.h"
  508. #include <sys/types.h> 
  509. #include <sys/wait.h>
  510. int main() { exit(0); }
  511. int t() { 
  512. union wait x;
  513. WIFEXITED(x);        /* Generates compiler error if WIFEXITED
  514.              * uses an int. */
  515.  }
  516. EOF
  517. if eval $compile; then
  518.   :
  519. else
  520.   rm -rf conftest*
  521.    LOSSAGE="$LOSSAGE -DNO_UNION_WAIT" 
  522. fi
  523. rm -f conftest*
  524.  
  525.  
  526. # -----------------------------------------------------------------------
  527. #     Check if postscript prolog can be inlined.
  528. # -----------------------------------------------------------------------
  529. echo "checking if postscript prolog can be inlined"
  530. cat > conftest.c <<EOF
  531. #include "confdefs.h"
  532.  
  533. #include "$PWD/src/bltGrPS.h"
  534. int main() { exit(0); }
  535.  
  536. EOF
  537. eval $compile
  538. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  539.   :
  540. else
  541.    LOSSAGE="$LOSSAGE -DNO_INLINE_PROLOG" 
  542. fi
  543. rm -fr conftest*
  544.  
  545.  
  546.     
  547. # -----------------------------------------------------------------------
  548. #     Run xmkmf to check for location of X libraries and includes.
  549. #    Fill in some default values if we still can't find anything.
  550. # -----------------------------------------------------------------------
  551. # If we find X, set shell vars x_includes and x_libraries to the paths.
  552. no_x=true
  553. echo checking for X include and library files with xmkmf
  554. rm -fr conftestdir
  555. if mkdir conftestdir; then
  556.   cd conftestdir
  557.   cat > Imakefile <<\EOF
  558. acfindx:
  559.     @echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
  560. EOF
  561.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  562.     no_x=
  563.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  564.     eval `make acfindx | grep -v make`
  565.     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
  566.     if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
  567.       im_usrlibdir=$im_libdir
  568.     fi
  569.     case "$im_incroot" in
  570.     /usr/include) ;;
  571.     *) x_includes="$im_incroot" ;;
  572.     esac
  573.     case "$im_usrlibdir" in
  574.     /usr/lib | /lib) ;;
  575.     *) x_libraries="$im_usrlibdir" ;;
  576.     esac
  577.   fi
  578.   cd ..
  579.   rm -fr conftestdir
  580. fi
  581.  
  582. if test -z "$im_usrlibdir"; then
  583. echo checking for X include and library files directly
  584. cat > conftest.c <<EOF
  585. #include "confdefs.h"
  586. #include <X11/Intrinsic.h>
  587. EOF
  588. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  589. if test -z "$err"; then
  590.   rm -rf conftest*
  591.   no_x=
  592.  
  593. else
  594.   rm -rf conftest*
  595.   for dir in \
  596.     /usr/local/include \
  597.     /usr/unsupported/include \
  598.     /usr/x386/include \
  599.     /usr/local/x11r5/include \
  600.     /usr/include/X11R5 \
  601.     /usr/include/X11R4 \
  602.     /usr/X11R5/include \
  603.     /usr/X11/include \
  604.     /usr/openwin/include \
  605.     /usr/openwin/share/include \
  606.     /usr/lpp/Xamples/include \
  607.     ; \
  608.   do
  609.     if test -r $dir/X11/Intrinsic.h; then
  610.       x_includes=$dir; no_x=
  611.       break
  612.     fi
  613.   done
  614. fi
  615. rm -f conftest*
  616.  
  617. # Check for the libraries.  First see if replacing the `include' by
  618. # `lib' works.
  619. LIBS_save="${LIBS}"
  620. LIBS="${LIBS} -lXt"
  621. have_lib=""
  622. echo checking for -lXt
  623. cat > conftest.c <<EOF
  624. #include "confdefs.h"
  625.  
  626. int main() { exit(0); }
  627. int t() { main(); }
  628. EOF
  629. if eval $compile; then
  630.   rm -rf conftest*
  631.   have_lib="1"
  632.  
  633. fi
  634. rm -f conftest*
  635. LIBS="${LIBS_save}"
  636. if test -n "${have_lib}"; then
  637.    :; no_x=
  638. else
  639.    :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  640.   /usr/local/lib \
  641.   /usr/unsupported/lib \
  642.   /usr/x386/lib \
  643.   /usr/local/x11r5/lib \
  644.   /usr/lib/X11 \
  645.   /usr/lib/X11R4 \
  646.   /usr/X11R5/lib \
  647.   /usr/X11/lib \
  648.   /usr/openwin/lib \
  649.   /usr/lpp/Xamples/lib \
  650.   ; \
  651. do
  652.   for extension in a so sl; do
  653.     if test -r $dir/libXt.$extension; then
  654.       x_libraries=$dir; no_x=
  655.       break 2
  656.     fi
  657.   done
  658. done
  659. fi
  660.  
  661. fi
  662. if test -n "$verbose"; then
  663.   test -n "$x_includes" && echo "    found X11 headers in $x_includes"
  664.   test -n "$x_libraries" && echo "    found X11 libraries in $x_libraries"
  665. fi
  666.  
  667. XINCDIR="$x_includes"
  668. if test -z "$XINCDIR" ; then
  669.     cat > conftest.c <<EOF
  670. #include "confdefs.h"
  671. #include <X11/Intrinsic.h>
  672. EOF
  673. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  674. if test -z "$err"; then
  675.   rm -rf conftest*
  676.    XINCDIR="default" 
  677.  
  678. else
  679.   rm -rf conftest*
  680.   
  681.     places="/usr/X11/include \
  682.     /usr/X386/include \
  683.     /usr/X11R5/include \
  684.     /usr/local/X11R5/include \
  685.     /usr/include/X11R5 \
  686.     /usr/openwin/include \
  687.     /usr/local/X11R4/include \
  688.     /usr/include/X11R4 \
  689.     /usr/local/include \
  690.     /usr/unsupported/include \
  691.     /usr/include"
  692.     for dir in $places; do
  693.     if test -r $dir/X11/Intrinsic.h; then
  694.         XINCDIR=$dir
  695.         break
  696.     fi
  697.     done
  698.     if test -z "$XINCDIR" ; then
  699.         echo "Warning:  couldn't find any X11 include files."
  700.         XINCDIR="default"
  701.     fi 
  702. fi
  703. rm -f conftest*
  704. fi
  705. if test "$XINCDIR" = "/usr/include" ; then
  706.     XINCDIR="default"
  707. fi
  708.  
  709. XLIBDIR="$x_libraries"
  710. if test -z "$XLIBDIR" ; then
  711.     LIBS_save="${LIBS}"
  712. LIBS="${LIBS} -lX11"
  713. have_lib=""
  714. echo checking for -lX11
  715. cat > conftest.c <<EOF
  716. #include "confdefs.h"
  717.  
  718. int main() { exit(0); }
  719. int t() { main(); }
  720. EOF
  721. if eval $compile; then
  722.   rm -rf conftest*
  723.   have_lib="1"
  724.  
  725. fi
  726. rm -f conftest*
  727. LIBS="${LIBS_save}"
  728. if test -n "${have_lib}"; then
  729.    :;  XLIBDIR="default" 
  730. else
  731.    :; 
  732.     places="/usr/X11/lib \
  733.         /usr/X386/lib \
  734.         /usr/X11R5/lib \
  735.         /usr/local/X11R5/lib \
  736.         /usr/lib/X11R5 \
  737.         /usr/openwin/lib \
  738.         /usr/local/X11R4/lib \
  739.         /usr/lib/X11R4 \ 
  740.         /usr/local/lib \
  741.         /usr/unsupported/lib \
  742.         /usr/lib \
  743.         /lib"
  744.     for dir in $places; do
  745.         if test -r $dir/libX11.a; then
  746.             XLIBDIR=$dir
  747.             break
  748.         fi
  749.     done
  750.     if test -z "$XLIBDIR" ; then
  751.     echo "Warning:  couldn't find the X11 library archive. "
  752.     XLIBDIR="default"
  753.     fi 
  754. fi
  755.  
  756. fi
  757. if test "$XLIBDIR" = "/usr/lib" ; then
  758.     XLIBDIR="default"
  759. fi
  760.  
  761. XINCSW=""
  762. if test "$XINCDIR" != "default" ; then
  763.     XINCSW="-I$XINCDIR"
  764. fi
  765.  
  766. XLIBSW=""
  767. if test "$XLIBDIR" != "default" ; then
  768.     XLIBSW="-L$XLIBDIR"
  769. fi
  770.  
  771.  
  772.  
  773. # -----------------------------------------------------------------------
  774. #
  775. #     Make some guesses where the Tcl/Tk include files and 
  776. #    libraries are.  I'm not crazy about doing it this way.  
  777. #    It might be better to specify some command-line options
  778. #    when invoking configure.
  779. #
  780. #     Look first in the Tcl/Tk distributions and then move on 
  781. #    to the standard include file/library locations.  If it's 
  782. #    still not found then query for it.
  783. #
  784. # -----------------------------------------------------------------------
  785.  
  786. # -----------------------------------------------------------------------
  787. #    tcl.h
  788. # -----------------------------------------------------------------------
  789. echo "checking for tcl.h"
  790. TCLINCDIR=""
  791. places="$PWD/../tcl7.5a2/generic \
  792.     $PWD/../tcl7.4 \
  793.     $prefix/include \
  794.     $XINCDIR/tk \
  795.     $XINCDIR \
  796.     /usr/local/include \
  797.     /usr/include"
  798. for dir in $places; do
  799.     if test -r $dir/tcl.h ; then
  800.         TCLINCDIR=$dir
  801.         break
  802.     fi
  803. done
  804. while test -z "$TCLINCDIR" ; do
  805.     echo "What directory contains tcl.h (absolute path, version 7.4+) ?"
  806.     read TCLINCDIR
  807. done
  808. if test "$TCLINCDIR" = "/usr/include" ; then
  809.     TCLINCDIR= "default"
  810. fi
  811.  
  812. TCLINCSW=""
  813. if test "$TCLINCDIR" != "default" ; then
  814.     TCLINCSW="-I$TCLINCDIR"
  815. fi
  816.  
  817.  
  818. # -----------------------------------------------------------------------
  819. #    libtcl.a
  820. # -----------------------------------------------------------------------
  821. echo "checking for libtcl.a"
  822. TCLLIBDIR=""
  823. places="$PWD/../tcl7.5a2/unix \
  824.     $PWD/../tcl7.4 \
  825.     $prefix/lib \
  826.     $XLIBDIR \
  827.     /usr/local/lib \
  828.     /usr/lib"
  829. for dir in $places; do
  830.     if test -r $dir/libtcl.a ; then
  831.         TCLLIBDIR=$dir
  832.         break
  833.     fi
  834. done
  835. while test -z "$TCLLIBDIR" ; do
  836.     echo "What directory contains libtcl.a (version 7.4+) ?"
  837.     read TCLLIBDIR
  838. done
  839. if test "$TCLLIBDIR" = "/usr/lib" ; then
  840.     TCLLIBDIR= "default"
  841. fi
  842.  
  843. TCLLIBSW=""
  844. if test "$TCLLIBDIR" != "default" ; then
  845.     TCLLIBSW="-L$TCLLIBDIR"
  846. fi
  847.  
  848.  
  849.  
  850. # -----------------------------------------------------------------------
  851. #     tk.h
  852. # -----------------------------------------------------------------------
  853. echo "checking for tk.h"
  854. TKINCDIR=""
  855. places="$PWD/../tk4.1a2/generic \
  856.     $PWD/../tk4.0 \
  857.     $XINCDIR/tk \
  858.     $XINCDIR \
  859.     $prefix/include \
  860.     /usr/local/include \
  861.     /usr/include"
  862. for dir in $places; do
  863.     if test -r $dir/tk.h ; then
  864.         TKINCDIR=$dir
  865.         break
  866.     fi
  867. done
  868. while test -z "$TKINCDIR" ; do
  869.     echo "What directory contains tk.h (absolute path, version 4.0+) ?"
  870.     read TKINCDIR
  871. done
  872. if test "$TKINCDIR" = "/usr/include" ; then
  873.     TKINCDIR="default"
  874. fi
  875.  
  876. TKINCSW=""
  877. if test "$TKINCDIR" != "default" ; then
  878.     TKINCSW="-I$TKINCDIR"
  879. fi
  880.  
  881.  
  882. # -----------------------------------------------------------------------
  883. #     libtk.a
  884. # -----------------------------------------------------------------------
  885. echo "checking for libtk.a"
  886. TKLIBDIR=""
  887. places="$PWD/../tk4.1a2/unix \
  888.     $PWD/../tk4.0 \
  889.     $prefix/lib \
  890.     $XLIBDIR \
  891.     /usr/local/lib \
  892.     /usr/lib"
  893. for dir in $places; do
  894.     if test -r $dir/libtk.a ; then
  895.         TKLIBDIR=$dir
  896.         break
  897.     fi
  898. done
  899. while test -z "$TKLIBDIR" ; do
  900.     echo "What directory contains libtk.a (version 4.0+) ?"
  901.     read TKLIBDIR
  902. done
  903. if test "$TKLIBDIR" = "/usr/lib" ; then
  904.     TKLIBDIR="default"
  905. fi
  906.  
  907. TKLIBSW=""
  908. if test "$TKLIBDIR" != "default" ; then
  909.     TKLIBSW="-L$TKLIBDIR"
  910. fi
  911.  
  912.  
  913.  
  914.  
  915. #--------------------------------------------------------------------
  916. #    Check for the existence of various libraries.  The order here
  917. #    is important, so that then end up in the right order in the
  918. #    command line generated by Make.
  919. #--------------------------------------------------------------------
  920. LIBS_save="${LIBS}"
  921. LIBS="${LIBS} -lXbsd"
  922. have_lib=""
  923. echo checking for -lXbsd
  924. cat > conftest.c <<EOF
  925. #include "confdefs.h"
  926.  
  927. int main() { exit(0); }
  928. int t() { main(); }
  929. EOF
  930. if eval $compile; then
  931.   rm -rf conftest*
  932.   have_lib="1"
  933.  
  934. fi
  935. rm -f conftest*
  936. LIBS="${LIBS_save}"
  937. if test -n "${have_lib}"; then
  938.    :; LIBS="$LIBS -lXbsd"
  939. else
  940.    :; 
  941. fi
  942.  
  943. LIBS_save="${LIBS}"
  944. LIBS="${LIBS} -lsocket"
  945. have_lib=""
  946. echo checking for -lsocket
  947. cat > conftest.c <<EOF
  948. #include "confdefs.h"
  949.  
  950. int main() { exit(0); }
  951. int t() { main(); }
  952. EOF
  953. if eval $compile; then
  954.   rm -rf conftest*
  955.   have_lib="1"
  956.  
  957. fi
  958. rm -f conftest*
  959. LIBS="${LIBS_save}"
  960. if test -n "${have_lib}"; then
  961.    :; LIBS="$LIBS -lsocket"
  962. else
  963.    :; 
  964. fi
  965.  
  966. LIBS_save="${LIBS}"
  967. LIBS="${LIBS} -lnsl"
  968. have_lib=""
  969. echo checking for -lnsl
  970. cat > conftest.c <<EOF
  971. #include "confdefs.h"
  972.  
  973. int main() { exit(0); }
  974. int t() { main(); }
  975. EOF
  976. if eval $compile; then
  977.   rm -rf conftest*
  978.   have_lib="1"
  979.  
  980. fi
  981. rm -f conftest*
  982. LIBS="${LIBS_save}"
  983. if test -n "${have_lib}"; then
  984.    :; LIBS="$LIBS -lnsl"
  985. else
  986.    :; 
  987. fi
  988.  
  989. # -----------------------------------------------------------------------
  990. #     The library libieee.a is a Linux deal. I don't know what effect 
  991. #    it will have.
  992. # -----------------------------------------------------------------------
  993. LIBS_save="${LIBS}"
  994. LIBS="${LIBS} -lieee"
  995. have_lib=""
  996. echo checking for -lieee
  997. cat > conftest.c <<EOF
  998. #include "confdefs.h"
  999.  
  1000. int main() { exit(0); }
  1001. int t() { main(); }
  1002. EOF
  1003. if eval $compile; then
  1004.   rm -rf conftest*
  1005.   have_lib="1"
  1006.  
  1007. fi
  1008. rm -f conftest*
  1009. LIBS="${LIBS_save}"
  1010. if test -n "${have_lib}"; then
  1011.    :; LIBS="$LIBS -lieee"
  1012. else
  1013.    :; 
  1014. fi
  1015.  
  1016. LIBS_save="${LIBS}"
  1017. LIBS="${LIBS} -lm"
  1018. have_lib=""
  1019. echo checking for -lm
  1020. cat > conftest.c <<EOF
  1021. #include "confdefs.h"
  1022.  
  1023. int main() { exit(0); }
  1024. int t() { main(); }
  1025. EOF
  1026. if eval $compile; then
  1027.   rm -rf conftest*
  1028.   have_lib="1"
  1029.  
  1030. fi
  1031. rm -f conftest*
  1032. LIBS="${LIBS_save}"
  1033. if test -n "${have_lib}"; then
  1034.    :; LIBS="$LIBS -lm"
  1035. else
  1036.    :; 
  1037. fi
  1038.  
  1039. LIBS_save="${LIBS}"
  1040. LIBS="${LIBS} -ldl"
  1041. have_lib=""
  1042. echo checking for -ldl
  1043. cat > conftest.c <<EOF
  1044. #include "confdefs.h"
  1045.  
  1046. int main() { exit(0); }
  1047. int t() { main(); }
  1048. EOF
  1049. if eval $compile; then
  1050.   rm -rf conftest*
  1051.   have_lib="1"
  1052.  
  1053. fi
  1054. rm -f conftest*
  1055. LIBS="${LIBS_save}"
  1056. if test -n "${have_lib}"; then
  1057.    :; LIBS="$LIBS -ldl"
  1058. else
  1059.    :; 
  1060. fi
  1061.  
  1062.  
  1063.  
  1064. #--------------------------------------------------------------------
  1065. #    Set flags to generate shared libraries for systems that we 
  1066. #    know about.
  1067. #--------------------------------------------------------------------
  1068. echo "checking how to make shared libraries"
  1069. SHLIB_CCFLAGS=""
  1070. SHLIB_LDFLAGS=""
  1071. SHLIB_LOADER=""
  1072. SHLIB_SUFFIX=""
  1073. if test -z "$uname_found"; then
  1074.   # Extract the first word of `uname', so it can be a program name with args.
  1075.   set dummy uname; word=$2
  1076.   echo checking for $word
  1077.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1078.   for dir in $PATH; do
  1079.     test -z "$dir" && dir=.
  1080.     if test -f $dir/$word; then
  1081.       uname_found="1"
  1082.       break
  1083.     fi
  1084.   done
  1085.   IFS="$saveifs"
  1086. fi
  1087. test -z "$uname_found" && uname_found="0"
  1088. test -n "$uname_found" && test -n "$verbose" && echo "    setting uname_found to $uname_found"
  1089.  
  1090.  if test $uname_found -eq 1 ; then
  1091.     system=`uname -s`-`uname -r`
  1092.     case $system in 
  1093.       SunOS-4*) 
  1094.         SHLIB_CCFLAGS="-pic"
  1095.         SHLIB_LDFLAGS="-assert pure-text"
  1096.         SHLIB_LOADER="ld"
  1097.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION).$(MINOR_VERSION)'
  1098.         ;;
  1099.       HP-UX-*.09.*)
  1100.         SHLIB_CCFLAGS="+z"
  1101.         SHLIB_LDFLAGS="-b -n"
  1102.         SHLIB_LOADER="ld"
  1103.         SHLIB_SUFFIX=".sl"
  1104.         ;;
  1105.       HP-UX-*.10.*)
  1106.         SHLIB_CCFLAGS="+z"
  1107.         SHLIB_LDFLAGS="-b -n"
  1108.         SHLIB_LOADER="ld"
  1109.         SHLIB_SUFFIX=".sl"
  1110.         ;;
  1111.       SunOS-5*)
  1112.         SHLIB_CCFLAGS="-K pic"
  1113.         SHLIB_LDFLAGS='-G -ztext -h $(SHARED_LIBRARY)'
  1114.         SHLIB_LOADER="$CC"
  1115.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION)'
  1116.         ;;
  1117.       OSF-1.*)
  1118.         SHLIB_CCFLAGS="-fpic"
  1119.         SHLIB_LDFLAGS="-shared"
  1120.         SHLIB_LOADER="$CC"
  1121.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION)'
  1122.     ;;
  1123.       IRIX-5.*)
  1124.         SHLIB_CCFLAGS="-KPIC"
  1125.         SHLIB_LDFLAGS="-shared"
  1126.         SHLIB_LOADER="$CC"
  1127.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION)'
  1128.         ;;
  1129.       *)
  1130.     echo "Don't know how to make shared libraries for $system"
  1131.     ;;
  1132.     esac
  1133.     if test ! -z "SHLIB_CCFLAGS" ; then 
  1134.         if test "$compiler" = "gcc" ; then
  1135.             SHLIB_CCFLAGS="-fpic"
  1136.         fi
  1137.     fi
  1138. fi 
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145. #--------------------------------------------------------------------
  1146. #    Propagate prefix argument as installation directory.
  1147. #--------------------------------------------------------------------
  1148. DESTDIR="$prefix"
  1149. BINDIR="$DESTDIR/bin"
  1150. LIBDIR="$DESTDIR/lib"
  1151. MANDIR="$DESTDIR/man"
  1152. BLT_LIBRARY="$DESTDIR/lib/blt"
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160. #--------------------------------------------------------------------
  1161. #
  1162. #    Generate the following Makefiles
  1163. #
  1164. #       ./Makefile
  1165. #       ./src/Makefile
  1166. #       ./src/shared/Makefile
  1167. #       ./man/Makefile
  1168. #       ./library/Makefile
  1169. #
  1170. #--------------------------------------------------------------------
  1171. # Set default prefixes.
  1172. if test -n "$prefix"; then
  1173.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1174.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1175. fi
  1176. if test -n "$exec_prefix"; then
  1177.   prsub="$prsub
  1178. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  1179. fi
  1180. # Quote sed substitution magic chars in DEFS.
  1181. cat >conftest.def <<EOF
  1182. $DEFS
  1183. EOF
  1184. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  1185. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  1186. rm -f conftest.def
  1187. # Substitute for predefined variables.
  1188.  
  1189. trap 'rm -f config.status; exit 1' 1 3 15
  1190. echo creating config.status
  1191. rm -f config.status
  1192. cat > config.status <<EOF
  1193. #!/bin/sh
  1194. # Generated automatically by configure.
  1195. # Run this file to recreate the current configuration.
  1196. # This directory was configured as follows,
  1197. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1198. #
  1199. # $0 $configure_args
  1200.  
  1201. for arg
  1202. do
  1203.   case "\$arg" in
  1204.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1205.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1206.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1207.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1208.   esac
  1209. done
  1210.  
  1211. trap 'rm -fr Makefile src/Makefile src/shared/Makefile man/Makefile library/Makefile src/bltConfig.h conftest*; exit 1' 1 3 15
  1212. CC='$CC'
  1213. CDEBUGFLAGS='$CDEBUGFLAGS'
  1214. prefix='$prefix'
  1215. INSTALL='$INSTALL'
  1216. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1217. INSTALL_DATA='$INSTALL_DATA'
  1218. RANLIB='$RANLIB'
  1219. CPP='$CPP'
  1220. LOSSAGE='$LOSSAGE'
  1221. XINCSW='$XINCSW'
  1222. XLIBSW='$XLIBSW'
  1223. XLIBDIR='$XLIBDIR'
  1224. TCLINCSW='$TCLINCSW'
  1225. TCLLIBSW='$TCLLIBSW'
  1226. TCLLIBDIR='$TCLLIBDIR'
  1227. TKINCSW='$TKINCSW'
  1228. TKLIBSW='$TKLIBSW'
  1229. TKLIBDIR='$TKLIBDIR'
  1230. LIBS='$LIBS'
  1231. uname_found='$uname_found'
  1232. SHLIB_CCFLAGS='$SHLIB_CCFLAGS'
  1233. SHLIB_LDFLAGS='$SHLIB_LDFLAGS'
  1234. SHLIB_LOADER='$SHLIB_LOADER'
  1235. SHLIB_SUFFIX='$SHLIB_SUFFIX'
  1236. DESTDIR='$DESTDIR'
  1237. BINDIR='$BINDIR'
  1238. LIBDIR='$LIBDIR'
  1239. MANDIR='$MANDIR'
  1240. BLT_LIBRARY='$BLT_LIBRARY'
  1241. srcdir='$srcdir'
  1242. prefix='$prefix'
  1243. exec_prefix='$exec_prefix'
  1244. prsub='$prsub'
  1245. extrasub='$extrasub'
  1246. EOF
  1247. cat >> config.status <<\EOF
  1248.  
  1249. top_srcdir=$srcdir
  1250.  
  1251. CONFIG_FILES=${CONFIG_FILES-"Makefile src/Makefile src/shared/Makefile man/Makefile library/Makefile"}
  1252. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1253.   srcdir=$top_srcdir
  1254.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1255.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1256.   if test "$dir" != "$file"; then
  1257.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1258.     test ! -d $dir && mkdir $dir
  1259.   fi
  1260.   echo creating $file
  1261.   rm -f $file
  1262.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1263.   sed -e "
  1264. $prsub
  1265. $extrasub
  1266. s%@CC@%$CC%g
  1267. s%@CDEBUGFLAGS@%$CDEBUGFLAGS%g
  1268. s%@prefix@%$prefix%g
  1269. s%@INSTALL@%$INSTALL%g
  1270. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1271. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1272. s%@RANLIB@%$RANLIB%g
  1273. s%@CPP@%$CPP%g
  1274. s%@LOSSAGE@%$LOSSAGE%g
  1275. s%@XINCSW@%$XINCSW%g
  1276. s%@XLIBSW@%$XLIBSW%g
  1277. s%@XLIBDIR@%$XLIBDIR%g
  1278. s%@TCLINCSW@%$TCLINCSW%g
  1279. s%@TCLLIBSW@%$TCLLIBSW%g
  1280. s%@TCLLIBDIR@%$TCLLIBDIR%g
  1281. s%@TKINCSW@%$TKINCSW%g
  1282. s%@TKLIBSW@%$TKLIBSW%g
  1283. s%@TKLIBDIR@%$TKLIBDIR%g
  1284. s%@LIBS@%$LIBS%g
  1285. s%@uname_found@%$uname_found%g
  1286. s%@SHLIB_CCFLAGS@%$SHLIB_CCFLAGS%g
  1287. s%@SHLIB_LDFLAGS@%$SHLIB_LDFLAGS%g
  1288. s%@SHLIB_LOADER@%$SHLIB_LOADER%g
  1289. s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
  1290. s%@DESTDIR@%$DESTDIR%g
  1291. s%@BINDIR@%$BINDIR%g
  1292. s%@LIBDIR@%$LIBDIR%g
  1293. s%@MANDIR@%$MANDIR%g
  1294. s%@BLT_LIBRARY@%$BLT_LIBRARY%g
  1295. s%@srcdir@%$srcdir%g
  1296. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1297. fi; done
  1298.  
  1299. CONFIG_HEADERS=${CONFIG_HEADERS-"src/bltConfig.h"}
  1300. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  1301. echo creating $file
  1302.  
  1303. # These sed commands are put into SEDDEFS when defining a macro.
  1304. # They are broken into pieces to make the sed script easier to manage.
  1305. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1306. # is the cpp macro being defined and VALUE is the value it is being given.
  1307. # Each defining turns into a single global substitution command.
  1308. #
  1309. # SEDd sets the value in "#define NAME VALUE" lines.
  1310. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1311. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1312. SEDdC='\3'
  1313. SEDdD='@g'
  1314. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1315. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1316. SEDuB='\([     ]\)@\1#\2define\3'
  1317. SEDuC=' '
  1318. SEDuD='\4@g'
  1319. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1320. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1321. SEDeB='$@\1#\2define\3'
  1322. SEDeC=' '
  1323. SEDeD='@g'
  1324. rm -f conftest.sed
  1325. EOF
  1326. # Turn off quoting long enough to insert the sed commands.
  1327. rm -f conftest.sh
  1328. cat > conftest.sh <<EOF
  1329. $SEDDEFS
  1330. EOF
  1331.  
  1332. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1333. # on the size of here documents.
  1334.  
  1335. # Maximum number of lines to put in a single here document.
  1336. maxshlines=9
  1337.  
  1338. while :
  1339. do
  1340.   # wc gives bogus results for an empty file on some systems.
  1341.   lines=`grep -c . conftest.sh`
  1342.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1343.   rm -f conftest.s1 conftest.s2
  1344.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1345.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1346.   # Write a limited-size here document to append to conftest.sed.
  1347.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1348.   cat conftest.s1 >> config.status
  1349.   echo 'CONFEOF' >> config.status
  1350.   rm -f conftest.s1 conftest.sh
  1351.   mv conftest.s2 conftest.sh
  1352. done
  1353. rm -f conftest.sh
  1354.  
  1355. # Now back to your regularly scheduled config.status.
  1356. cat >> config.status <<\EOF
  1357. # This sed command replaces #undef's with comments.  This is necessary, for
  1358. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1359. # on some systems where configure will not decide to define it in
  1360. # src/bltConfig.h.
  1361. cat >> conftest.sed <<\CONFEOF
  1362. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1363. CONFEOF
  1364. rm -f conftest.h
  1365. # Break up the sed commands because old seds have small limits.
  1366. maxsedlines=20
  1367. cp $top_srcdir/$file.in conftest.h1
  1368. while :
  1369. do
  1370.   lines=`grep -c . conftest.sed`
  1371.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1372.   rm -f conftest.s1 conftest.s2 conftest.h2
  1373.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1374.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1375.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1376.   rm -f conftest.s1 conftest.h1 conftest.sed
  1377.   mv conftest.h2 conftest.h1
  1378.   mv conftest.s2 conftest.sed
  1379. done
  1380. rm -f conftest.sed conftest.h
  1381. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1382. cat conftest.h1 >> conftest.h
  1383. rm -f conftest.h1
  1384. if cmp -s $file conftest.h 2>/dev/null; then
  1385.   # The file exists and we would not be changing it.
  1386.   echo "$file is unchanged"
  1387.   rm -f conftest.h
  1388. else
  1389.   rm -f $file
  1390.   mv conftest.h $file
  1391. fi
  1392. fi; done
  1393.  
  1394.  
  1395.  
  1396. exit 0
  1397. EOF
  1398. chmod +x config.status
  1399. ${CONFIG_SHELL-/bin/sh} config.status
  1400.  
  1401.  
  1402. #--------------------------------------------------------------------
  1403. #    Print out some of the more important settings 
  1404. #--------------------------------------------------------------------
  1405. echo "
  1406. Configuration results (edit and run ./config.status to modify):
  1407.  
  1408. directory containing \"tcl.h\"      => $TCLINCDIR
  1409. directory containing \"tk.h\"       => $TKINCDIR
  1410. directory containing \"X11/Xlib.h\" => $XINCDIR
  1411. directory containing \"libtcl.a\"   => $TCLLIBDIR
  1412. directory containing \"libtk.a\"    => $TKLIBDIR
  1413. directory containing \"libX11.a\"   => $XLIBDIR
  1414. directory to install \"blt_wish\"   => $BINDIR
  1415. directory to install \"libBLT.a\"   => $LIBDIR
  1416. directory to install BLT library files => $BLT_LIBRARY
  1417. "
  1418.